//
//  MTView.swift
//  OnemeetingDemo
//
//  Created by 张衡 on 2019/12/2.
//  Copyright © 2019 www.onemeeting.1meetingIos. All rights reserved.
//

import Foundation
import Cocoa

class MkView: NSView {
    
    override init(frame frameRect: NSRect) {
        super.init(frame: frameRect)
        self.setupUI()
    }
    
    func setupUI() {
        self.addSubview(defLab)
        defLab.snp.makeConstraints { (make) in
            make.width.equalTo(90)
            make.height.equalTo(15)
            make.centerY.equalToSuperview()
            make.left.equalTo(0)
        }
        
        self.addSubview(lineV)
        lineV.snp.makeConstraints { (make) in
            make.width.equalTo(1)
            make.height.equalTo(14)
            make.centerY.equalToSuperview()
            make.left.equalTo(90)
        }
        
        self.addSubview(defBtn)
        defBtn.snp.makeConstraints { (make) in
            make.width.height.equalTo(32)
            make.centerY.equalToSuperview()
            make.right.equalTo(-10)
        }
        
        self.addSubview(defaulTef)
        defaulTef.snp.makeConstraints { (make) in
            make.left.equalTo(defLab.snp.right).offset(10)
            make.right.equalTo(defBtn.snp.left).offset(-10)
            make.centerY.equalToSuperview()
            make.height.equalTo(18)
        }
    }
    
    
    
    lazy var lineV: NSView = {
        let lineV = NSView()
        lineV.wantsLayer = true
        lineV.layer?.backgroundColor = NSColor.black.cgColor
        return lineV
    }()
    
    lazy var defLab: NSLabel = {
        let lab = NSLabel.label(title: "主持会议", textColor: NSColor.black, font: NSFont.systemFont(ofSize: 13))
        lab.alignment = .center
        return lab
    }()

    lazy var defaulTef: BaseTextField = {
        let tef = BaseTextField()
        tef.wantsLayer = true
        tef.isBordered = false
        tef.zh_cell.title = "622869"
        tef.zh_cell.textColor = NSColor.white
        tef.zh_cell.font = NSFont.systemFont(ofSize: 14)
        tef.backgroundColor = NSColor.clear
        tef.focusRingType = NSFocusRingType.none
        return tef
    }()
    
    
    lazy var defBtn: LLCustomBtn = {
        let btn = LLCustomBtn()
        btn.isHandCursor = true
        btn.defaultTitleColor = NSColor.white
        //btn.defaultFont = NSFont.systemFont(ofSize: 12)
        btn.defaultBackgroundColor = NSColor.green
        btn.defaultBackgroundImage = NSImage.init(named: NSImage.Name.init("ic_Dial"))
        btn.selectedBackgroundImage = NSImage.init(named: NSImage.Name.init("ic_Dial_select"))
        btn.rectCorners = LLRectCornerAllCorners
        btn.textUnderLineStyle = LLTextUnderLineStyleDeleteDouble
        return btn
    }()
    
    required init?(coder decoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
